package com.zucc.controller.req;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author : charspan
 * @Description :
 * @create : 2021-12-23 5:38 下午
 */
@Data
@ApiModel("新增设备参数")
public class DeviceAddReq {

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "分类号")
    private String categoryNumber;

    @ApiModelProperty(value = "设备号")
    private String deviceNumber;

    @ApiModelProperty(value = "设备数量", required = true)
    private Integer count;

    @ApiModelProperty(value = "设备名称", required = true)
    private String deviceName;

    @ApiModelProperty(value = "型号")
    private String model;

    @ApiModelProperty(value = "规格")
    private String specifications;

    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    @ApiModelProperty(value = "购买日期")
    @DateTimeFormat(pattern="yyyy-MM-dd") 	//页面写入数据库时格式化
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @JSONField(format="yyyy-MM-dd") //数据库导出页面时json格式化
    private Date buyDate;

    @ApiModelProperty(value = "报废日期")
    @DateTimeFormat(pattern="yyyy-MM-dd") 	//页面写入数据库时格式化
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @JSONField(format="yyyy-MM-dd") //数据库导出页面时json格式化
    private Date scrapDate;

    @ApiModelProperty(value = "领用单位")
    private String useUnit;

    @ApiModelProperty(value = "领用人编号")
    private Long userId;

    @ApiModelProperty(value = "原存放地址")
    private String oldAddress;

    @ApiModelProperty(value = "现存放地址")
    private String newAddress;

    @ApiModelProperty(value = "来源，0:购买，1:历史导入，2:盘盈", required = true)
    private Integer source;

}
